/*
 *
 *  This file is part of Cfu
 *
 *  Cfu is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Cfu is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Cfu. If not, see <http://www.gnu.org/licenses/>.
 *
 *  cfuapplication.hpp - william le ferrand (william@corefarm.com) 29/04/2010 15:30
 *
 */

#ifndef CFU_APPLICATION_HPP_
#define CFU_APPLICATION_HPP_

// QT
#include <QObject>
#include <QSystemTrayIcon>
#include <QAction>
#include <QMainWindow>

// CFY
#include <mainwindow.hpp>
#include <configuration.hpp>
#include <submitter.hpp>

class cfuapplication_t : public QObject 
{
  Q_OBJECT
  
  public:
  cfuapplication_t(configuration_t *conf, submitter_t *subm);
  ~cfuapplication_t();

private slots:
  void _onTrayActivated(QSystemTrayIcon::ActivationReason reason);
  void _onShowWindow();
  void _onHideWindow();

  void _onAbout(); 
  void _onParameters(); 
  void _onLaunchJob(); 
  void _onSubmitJob(); 
  void _onQuit();
     
private:
  QAction *_newJobAction; 
  QAction *_submitJobAction; 
  QAction *_parametersAction; 
  QAction *_aboutAction; 
  QAction *_quitAction;

  QSystemTrayIcon *_trayIcon;
  QIcon _trayIconNormal;
  mainwindow_t *_mainWindow; 

  configuration_t *_conf;   
  submitter_t *_subm; 
}; 

#endif





